<template>
	<view>
		<button @click="chooseImg">上传照片</button>
		<image v-for="item in imgList" :src="item" mode="" @click="previewImg(item)"></image>
		<!-- #ifdef H5 -->
		<view>我希望只在h5页面中看见</view>
		<!-- #endif -->
		<!-- #ifdef MP-WEIXIN -->
		<view>我希望只在微信小程序中看见</view>
		<!-- #endif -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				imgList: []
			}
		},
		onLoad(options) {
			console.log(options)
		},
		methods: {
			chooseImg(){
				uni.chooseImage({
					count: 5,
					success: (res) => {
						console.log(res)
						this.imgList = res.tempFilePaths
					}
				})
			},
			previewImg(current){
				uni.previewImage({
					current,
					urls: this.imgList,
					loop:true
				})
			}
		}
	}
</script>

<style>
	
</style>
